import pytest,yagmail,logging
def log_cleect():
    logging.basicConfig(filename='log.log',filemode="a+",level=logging.DEBUG,format="%(filename)s->%(lineno)d->%(asctime)s->%(message)s")
def send_mail(filemate):
    mail=yagmail.SMTP(user='1582186006@qq.com',password='wnlqxmixkuyjbacg',host="smtp.qq.com")
    s=mail.send(to='1582186006@qq.com',subject="邮件",contents="邮件",attachments=filemate)
if __name__ == '__main__':
    log_cleect()
    pytest.main(["-s","test_buy.py","--alluredir=./baogao","--clean-alluredir"])
    import os
    os.system("allure generate ./baogao -o ./htmlreport --clean")
    # send_mail(["log.log","report.html"])